class Demand < ActiveRecord::Base
  validates_presence_of :projects,:description,:tag_id
  belongs_to :user
  belongs_to :tag
  has_many :offers, dependent: :destroy
  has_many :demand_read_logs
  def Demand.top_ten
    Demand.order('read_num desc').limit(10)
  end

end
